Define Program Logic Based On Return Codes

SoftwareShield System Feature Guide > User Interface Customization > Customize UI by Connecting to COM Events

## Define Program Logic Based on Return Codes

Your application will not always get events fired back when you need to invoke some logic of your own. In fact, specific events are generally only fired when ClientProtector processing can not continue without some piece of information from your user. Most function calls you make will simply return and it is the responsibility of your application to interpret the outcome of these calls based on the value of a "return code" reference parameter (passed in the context of that function call).

In all function calls to the ClientProtector where the outcome may be some logical state which you may require knowledge of in order to define your applications behaviour - a "return code" reference parameter is provided. In each of these function calls the name of that parameter is return_code.

The value that will be returned in that parameter indicates the outcome of the operation or the state of the license after the call has completed. Each function call in the SoftwareShield ClientProtector Reference notes what to expect from the return_code parameter. Your application must interpret the value of this parameter after each call which might require it and take action (if necessary) this action may require you to interact with the user or make further calls to the ClientProtector for more information.

Safety note: If the documentation for a particular function indicates that you might get a specific return_code value back from a call, but you are reasonably sure you will never get that value because of how you designed your license, you should still provide some default handling for catching the value. You should do this as a matter of good programming practice, even if this simply means displaying some error message. In the unlikely event that you do get the value, at least you will be aware of it and can track down the cause.

#### More Information

For a comprehensive list of all the available return_code values, see RETURNCODES in the SoftwareShield ClientProtector Reference.

For help on actually getting more information from the license, see ClientProtector Reference.